********************************************************************************
* Balyuk, Berger, and Hackney (2024)                                           *
* "What is Fueling FinTech Lending? The Role of Banking Market Structure"      *
* The Review of Corporate Financial Studies                                    *
********************************************************************************

clear all
clear matrix

***********************   Table III, Columns (1)-(2)   *************************

* open file *

	use "$code\DATA_Prosper_annual_county_w.dta", clear
	egen sy=group(state_fips year)
	
* large bank share *

	reghdfe Ysb1_P large_bank_l bank_access_l ///
		deposits_l log_pop_l ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_P.xls", ///
		replace stats(coef tstat) tdec(2) auto(2) bfmt(fc)	
	
	reghdfe Ysb1_P large_bank_l bank_access_l ///
		deposits_l log_pop_l median_income_l unemployment_l house_price_chg_l ///
		ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_P.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
	reghdfe Ysb1_P large_bank_l bank_access_l ///
		deposits_l log_pop_l median_income_l unemployment_l house_price_chg_l ///
		eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_P.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
		
* large vs small bank branches *
	
	reghdfe Ysb1_P large_bank_access_l small_bank_access_l ///
		deposits_l log_pop_l ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_P.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)	
	
	reghdfe Ysb1_P large_bank_access_l small_bank_access_l ///
		deposits_l log_pop_l median_income_l unemployment_l house_price_chg_l ///
		ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_P.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
	reghdfe Ysb1_P large_bank_access_l small_bank_access_l ///
		deposits_l log_pop_l median_income_l unemployment_l house_price_chg_l ///
		eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_P.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)	

* NB: Also see Table IA.19 in Internet Appendix *
		
***********************   Table III, Columns (3)-(4)   *************************

clear all
clear matrix

* open file - PSEUDO data *

	use "$code\DATA_FC_annual_county_w_pseudo.dta", clear
	egen sy=group(state_fips year)
	
* large bank share *

	reghdfe Ysb1_FC_pseudo large_bank_l_pseudo bank_access_l ///
		deposits_l log_pop_l ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_FC_pseudo.xls", ///
		replace stats(coef tstat) tdec(2) auto(2) bfmt(fc)	
	
	reghdfe Ysb1_FC_pseudo large_bank_l_pseudo bank_access_l ///
		deposits_l log_pop_l median_income_l unemployment_l house_price_chg_l ///
		ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_FC_pseudo.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
	reghdfe Ysb1_FC_pseudo large_bank_l_pseudo bank_access_l ///
		deposits_l log_pop_l median_income_l unemployment_l house_price_chg_l ///
		eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_FC_pseudo.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
		
* large vs small bank branches *
	
	reghdfe Ysb1_FC_pseudo large_bank_access_l_pseudo small_bank_access_l_pseudo ///
		deposits_l log_pop_l ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_FC_pseudo.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)	
	
	reghdfe Ysb1_FC_pseudo large_bank_access_l_pseudo small_bank_access_l_pseudo ///
		deposits_l log_pop_l median_income_l unemployment_l house_price_chg_l ///
		ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_FC_pseudo.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
	
	reghdfe Ysb1_FC_pseudo large_bank_access_l_pseudo small_bank_access_l_pseudo ///
		deposits_l log_pop_l median_income_l unemployment_l house_price_chg_l ///
		eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality, ///
		absorb(sy) cluster(fips)
	outreg2 using "$code\Table_III_FC_pseudo.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)	

* NB: Also see Table IA.20 in Internet Appendix *		
		